home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / c / vbcc_grexx.lha / vc_run.ged < prev    next >
Encoding:
Text File  |  1997-07-08  |  2.7 KB  |  98 lines

  1. /* 
  2. ** This script is a modification of another script (vc.ged) which was 
  3. ** written by me, so I could compile stuff useing vbcc through GoldEd.
  4. ** This Script Compliments that script by allowing you to run previously
  5. ** compiled programs without haveing to re-compile them. I converted
  6. ** this Script from a Script file written to compile stuff useing gcc 
  7. ** through GoldEd.  I truly hope the original author does not mind this. 
  8. ** I hope that whoever finds this script finds it useful in glueing together
  9. ** a truly cool compiler like vbcc and a killer Editor like GoldEd. 
  10. ** If you have any problems running this script, try messing with it
  11. ** a little, it's pretty strait forward and can be modified with little
  12. ** effort.  I of course take no liability for anything this script might
  13. ** do to your computer.  (Yeah like a rexx script is gonna do somethin
  14. ** catostrauphic).  I thought that I'de mention it so I don't get blamed
  15. ** for the end of the world when the highly improbable does happen.
  16. ** My thanks to Volker Barthelmann for writeing vbcc.  Hope you enjoy
  17. ** useing Golded with vbcc
  18. ** 
  19. **                            Sincerely,
  20. **                                Harlock
  21. **  
  22. */ 
  23.  
  24.  
  25.  
  26. OPTIONS RESULTS                             /* enable return codes     */
  27.  
  28. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  29.     address 'GOLDED.1'
  30.  
  31. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  32. OPTIONS FAILAT 6                            /* ignore warnings         */
  33. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  34.  
  35. host = ADDRESS()                              /* get GED's port    */
  36.  
  37. /* ------------------------- INSERT YOUR CODE HERE: ------------------ */
  38.  
  39. options results 
  40.  
  41. 'QUERY CAT'
  42.  
  43. 'QUERY ANYTEXT'
  44.  
  45. if (result = 'TRUE') then 
  46.  
  47.     do
  48.         'QUERY DOC VAR OLDNAME'             /* remember current file name */
  49.         
  50.         'QUERY PATH Var PFAD'
  51.         'QUERY FILE VAR FNAME'              
  52.  
  53.         Name = left(FNAME, Pos('.', FNAME) - 1)
  54.  
  55.         if right(PFAD,1) = ":" then NameB = PFAD || Name
  56.            else NameB = PFAD || '/' || Name
  57.  
  58.         Code = EXISTS(Code)
  59.  
  60.         'SAVE ALL'
  61.  
  62.         'REQUEST BODY="Run program ?" BUTTON="_run|_cancel"'
  63.  
  64.         if (result = 1) then do
  65.  
  66.             'QUERY CON VAR CON'
  67.  
  68.             shell
  69.             run NameB || ' > ' || CON
  70.             shell
  71.  
  72.         end
  73.  
  74.         'NAME NEW ' || oldname              /* restore old file name */
  75.     end
  76.  
  77. else do
  78.  
  79.     'REQUEST BODY="Text buffer is empty ?!"'
  80. end
  81.  
  82. 'UNLOCK' /* VERY important: unlock GUI */
  83. Exit
  84.  
  85.   GetFile:PROCEDURE
  86.  
  87.     ARG envv
  88.  
  89.     filename= envv
  90.     IF OPEN(fhandle,filename,"READ") THEN DO
  91.       readed=READLN(fhandle);
  92.       CALL CLOSE(fhandle);
  93.     END;
  94.     ELSE readed = "unset"
  95.  
  96.     RETURN readed
  97.  
  98.